<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/common/common.jsp" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    
    <title>保存模块</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="保存,模块">
	<meta http-equiv="description" content="This is my page">
	
	<style type="text/css">
	</style>
	
  </head>
  
  <body>
    <center>
    	<s:form name="frm" id="frm" method="post" action="" namespace="">
    		<s:hidden name="fm.id" id="fmId"></s:hidden>
    		<table cellspacing="1" cellpadding="3" width="100%" bgcolor="#CCCCCC">
    			<tr align="center" bgcolor="#FFFFFF">
    				<td width="30%" align="right" class="label">
    					模块名称：
    				</td>
    				<td width="70%" align="left">
    					<s:textfield name="fm.moduleName" id="moduleName" cssStyle="width:100%" maxlength="7"></s:textfield>
    				</td>
    			</tr>
    			<tr align="center" bgcolor="#FFFFFF">
    				<td align="right" class="label">
    					排序：
    				</td>
    				<td align="left">
    					<s:textfield name="fm.sort" id="sort" cssStyle="width:100%" maxlength="4"></s:textfield>
    				</td>
    			</tr>
    		</table>
    		<table width="100%" cellspacing="0">
    			<tr>
    				<td align="center" valign="bottom" height="30">
    					<input type="button" value="保存" class="btn" onclick="saveModule()" />
    				</td>
    			</tr>
    		</table>
    	</s:form>
    </center>
    
    <script type="text/javascript">
    function saveModule()
    {
    	var moduleName = $('#moduleName');
    	var sort = $('#sort');
    	if(!isNotNull(moduleName.val()))
    	{
    		showMsg('模块名称不能为空。', function(){moduleName.focus();});
    		return;
    	}
    	if(!isNotNull(sort.val()))
    	{
    		showMsg('排序不能为空。', function(){sort.focus();});
    		return;
    	}
    	if(checkInteger(sort) == false)
    	{
    		showMsg('排序有误。', function(){sort.focus();});
    		return;
    	}
    	var url = 'inner/flow/saveModule.action';
    	ajaxAction(url, 'post', 'frm', false, function(){
    		showMsg('保存成功。', function(){
    			var pWin = getParentWin();
    			pWin.location.href = pWin.location.href;
    			window.close();
    		});
    	});
    }
    </script>
  </body>
</html>
